#include"Graph.h"

void printgraph(Graph &graph, int n, int mark)
{
    if(mark <= 0)
    {
        for(int i = 0; i < n; i++)
        {
            for (Pair cp : graph.adjList[i])
            {
                cout << i << "--(" << cp.second << ")->" << cp.first << "  ";
            }
            cout << endl;
        }
    }
    else
    {
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < n; j++)
            {
                if(graph.adjMatrix[i][j] != MIN)
                cout << i << "--(" << graph.adjMatrix[i][j] << ")->" << j << "  "; 
            }
            cout << endl;
        }
    }
    
}

int main(int argc, char*argv[])
{
    vector<Edge> edges = 
    {
        {0, 1, 2}, {0, 2, 3},
        {1, 3, 4}, {2, 1, 6}
    };


    Graph graph(edges, 3, 0);
    printgraph(graph, 3, 0);
    cout << endl;
    Graph _graph(edges, 4, 1);
    printgraph(_graph, 4, 1);

    return 0;
}

